package com.yang.Relation;

import com.yang.autoConfig.Address;
import com.yang.autoConfig.Persion;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext ioc = new ClassPathXmlApplicationContext("beans-relation.xml");

        Address address = (Address) ioc.getBean("address1");
        System.out.println(address);

        Address address1 = (Address) ioc.getBean("address2");
        System.out.println(address1);

        Persion person = (Persion) ioc.getBean("person");
        System.out.println(person);
    }
}
